<?php 

head();

function getSCategory($child,$parent_id){
	
	 $sql_c = "SELECT
                    c.category_id,
                    d.Name,
					s.sef_url
                    
                FROM
                    category AS c,
                    category_description AS d,
					sef_url AS s
                WHERE
                
                    c.category_id = d.category_id
                    
                    AND
					
					c.category_id = s.query
                    
                    AND
                    
                    d.lang_id = '1'
					
					AND
                    
                    s.lang_id = '1'
					
					AND
                    
                    s.tamplate = 'category'
                    
                    AND
                    c.published
					
					AND parent_id = '".$parent_id."'
                    
                    ORDER BY c.order_number 
                    
                  ";
                
                    $result_c = query($sql_c);
                    
					if( $result_c){
					?>
                    
                    <ul >
                    <?php
                    while ($row = mysql_fetch_object($result_c)) {
                          ?>
                        <li class="<?=$child?>">
                        <a href="<?=HTTPS_BASE.$row->sef_url?>"><?=sth($row->Name)?></a>
        			<?php 
						if($child == 'parent') $child_new = 'child';
						if($child == 'child') $child_new = 'grand-child';
						getSCategory($child_new,$row->category_id);
						 ?>
                        </li>
        				<?php
					}
					
					?>
                    </ul>
                    <?php
					}
					
}

?>
  <div id="home-wrapper">
            <div id="front-home"><img src="<?=HTTPS_BASE?>images/home-front.jpg" alt=""></div>
            <div id="categories" class="cf">
                <ul>
                    <li class="parent">
                    <a href="<?=HTTPS_BASE?>category1"><img src="<?=HTTPS_BASE?>images/face.jpg" alt="">
</a>
                    </li>
                    <li class="parent">
                        <a href="<?=HTTPS_BASE?>category17"><img src="<?=HTTPS_BASE?>images/hair.jpg" alt=""></a>                    
                    </li>
                    <li class="parent">
                        <a href="<?=HTTPS_BASE?>category22"><img src="<?=HTTPS_BASE?>images/body.jpg" alt=""></a>
                    </li>
                </ul>
            </div>
            <div id="location-home">
                <div></div>
                <a href="<?=HTTPS_BASE?>map">
                <img src="<?=HTTPS_BASE?>images/map.jpg" alt="">
                </a>
            </div>
        </div> <!--#home-wrapper-->
<?php
foot('home');
?>